home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbsrtsem.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-11-09  |  1.6 KB  |  37 lines

  1. (*===========================================================================*)
  2. (* Semaphore control for ports                                               *)
  3. (*                                                                           *)
  4. (*   Copyright 1990 by H. Roy Engehausen.  All rights reserved.              *)
  5. (*   This software may be freely distributed and used, but it may not        *)
  6. (*   under any circumstances be sold by anyone other than the author.        *)
  7. (*   It may be distributed by a commercial company as long as it is          *)
  8. (*   for no cost.                                                            *)
  9. (*                                                                           *)
  10. (*===========================================================================*)
  11.  
  12. (*===========================================================================*)
  13. (* Get port semaphore                                                        *)
  14. (*===========================================================================*)
  15.  
  16. PROCEDURE get_port_semaphore;
  17.  
  18.   BEGIN;
  19.  
  20.     get_semaphore(active_port^.port_sema, sem_exclusive, FALSE);
  21.     get_semaphore(semaphore_interrupts, sem_shared, FALSE);
  22.  
  23.   END;
  24.  
  25. (*===========================================================================*)
  26. (* Free port semaphore                                                       *)
  27. (*===========================================================================*)
  28.  
  29. PROCEDURE free_port_semaphore;
  30.  
  31.   BEGIN;
  32.  
  33.     free_semaphore(active_port^.port_sema);
  34.     free_semaphore(semaphore_interrupts);
  35.  
  36.   END;
  37.